﻿using System;
using UnityEngine;

[Serializable]
public class CameraDragSmoothDamp : CameraDrag
{
    [SerializeField] private float moveTime = 0.3f;
    Vector3 curVelocity = Vector3.zero;
    protected override void OnCameraMove()
    {
        base.OnCameraMove();
        if (!isLaunchMove)
        {
            return;
        }

        Vector3 result =
            Vector3.SmoothDamp(dragCamera.transform.position, cameraTargetPos, ref curVelocity, moveTime);
        if (curVelocity == Vector3.zero)
        {
            isLaunchMove = false;
        }

        SetCameraPos(result);
    }
}